package com.kc.gb.device.common.adapter.feigns;

import com.kc.gb.base.dto.Result;
import com.kc.gb.device.common.adapter.dto.basic.rack.SimpleRackDto;
import com.kc.gb.device.common.adapter.dto.basic.rack.SimpleRackSelection;
import com.kc.gb.device.common.adapter.dto.basic.slot.SlotDto;
import com.kc.gb.device.common.adapter.dto.basic.slot.SlotSelection;
import com.kc.gb.device.common.adapter.dto.basic.station.dto.BasicStationDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "basic-station",url = "${hostIP}"/*,configuration = FeignConfig.class*/)
public interface BasicStationFeignClient {

    @GetMapping("/api/basic/warehouse/{warehouseId}/stations/findAll")
    Result<List<BasicStationDTO>> findStationSlots(@PathVariable("warehouseId") Long warehouseId);

    @RequestMapping(
            method = {RequestMethod.GET},
            value={"/api/basic/warehouse/{warehouseId}/stations/getByCode"}
    )
    Result<BasicStationDTO> getByCode(@RequestParam("warehouseId") Long warehouseId, @RequestParam("code")  String code);


    @RequestMapping(method = {RequestMethod.POST}, value={"api/basic/warehouse/{warehouseId}/rack/simple-query"})
    Result<List<SimpleRackDto>> querySimpleRack(@PathVariable("warehouseId")  Long warehouseId, @RequestBody SimpleRackSelection selection);

    @RequestMapping(method = {RequestMethod.POST}, value={"api/basic/warehouse/{warehouseId}/slot/queryWithoutPage"})
    Result<List<SlotDto>> findStationSlots(@PathVariable("warehouseId")  Long warehouseId, @RequestBody SlotSelection request);

}
